package cn.ljy.common.annotation.validate;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 使用方法
 * DecimalTwoPlaces(message = "必须恰好两位小数", groups = AddWorkValidation.class)
 */
@Target({ FIELD })
@Retention(RUNTIME)
@Constraint(validatedBy = DecimalMax10Int2ScaleValidator.class)
public @interface DecimalMax10Int2Scale {
    String message() default "最多10位整数且必须恰好2位小数";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}